import {ElButton, ElInput} from 'element-plus'
function createEditConfig() {
    const compentList = [];
    const componentMap = {}

    return {
        compentList,
        componentMap,
        register:(component)=>{
            compentList.push(component);
            componentMap[component.key] = component
        }
    }
}
export let registerConfig = createEditConfig()

registerConfig.register({
    lable:'文本',
    preview:()=>'预览文本',
    render:()=>'渲染文本',
    key:'text'
})
registerConfig.register({
    lable:'按钮',
    preview:()=><ElButton>预览按钮</ElButton>,
    render:()=><ElButton>渲染按钮</ElButton>,
    key:'button'
})
registerConfig.register({
    lable:'输入框',
    preview:()=><ElInput placeholder='预览输入框'></ElInput>,
    render:()=><ElInput placeholder='渲染输入框'></ElInput>,
    key:'input'
})